<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body style="font-family:Arial, Helvetica, sans-serif">
<table  border="1" cellspacing="0" cellpadding="10" style="font-size:12px; table-layout:fixed;">
  <tr>
    <th rowspan="2" scope="col">Shop</th>
    <?php foreach($this->prClist as $k => $v){?>
    <th colspan="2" scope="col" style="width:300px;"><?php echo $v['title_cate']?></th>
    <?php }?>
  	<th colspan="2" > Shop Total</th>
  </tr>
  
  <tr>
  <?php 
  $stLcdAmt = 0;
	  $stLcdQty = 0;
	  $stPtAmt = 0;
	  $stPtQty = 0;
  
  
  foreach($this->prClist as $k => $v){?>
    <th scope="col" width = "150" style="width:150px;" >LCD</th>
    <th scope="col" style="width:150px;" width = "150" >PARTS</th>
   <?php }?>
       <th >T LCD</th>
    <th >T PRS</th>
  </tr>
  <?php 
  	  
  
  	 foreach($this->arrRes as $shop => $detail ){
	  
	  $stLcdAmt = 0;
	  $stLcdQty = 0;
	  $stPtAmt = 0;
	  $stPtQty = 0;
	  
	  
	  
	  ?>
  <tr>
    <td><?php echo $this->arrRCenter[$shop]?></td>
    <?php foreach($this->prClist as $k => $v){?>
    <td><?php 
	if(isset($detail[$v['id_cate']]['LCD'])){
		echo "$".$detail[$v['id_cate']]['LCD']['AMT']." [".$detail[$v['id_cate']]['LCD']['QTY']."pcs]"; 
		$stLcdAmt += $detail[$v['id_cate']]['LCD']['AMT'];
		$stLcdQty += $detail[$v['id_cate']]['LCD']['QTY'];
		}
	
	?></td>
    <td><?php 
	if(isset($detail[$v['id_cate']]['PART'])){
		echo "$".$detail[$v['id_cate']]['PART']['AMT']." [".$detail[$v['id_cate']]['PART']['QTY']."pcs]"; 
		$stPtAmt += $detail[$v['id_cate']]['PART']['AMT'];
		$stPtQty += $detail[$v['id_cate']]['PART']['QTY'];
		}
	
	?></td>
    <?php }?>
    <td><?php echo "$".$stLcdAmt."[".$stLcdQty."]"?></td>
    <td><?php echo "$".$stPtAmt."[".$stPtQty."]"?></td>
  </tr>
  <?php }?>
</table>
</body>
</html>
